package com.xs.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xs.entity.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface MessageDao extends BaseMapper<Message> {

    @Select("select m.*,u.avatar ,u.nick_name from message m left join user u on m.uid = u.id where m.aid = #{aid} order by id desc")
    List<Message> findCommentDetail(@Param("aid")  Integer aid);
}
